<template>
  <div class="home">
    <div class="bannre wrap">
      <img src="../assets/img/banner.f559b49d.png" alt="" />
    </div>
    <div class="integralMall-center">
      <div class="wrap">
        <!-- 精品，更多 -->
        <div class="jingpin">
          <div class="jingpin-l">
            <img src="../assets/img/jingpin.png" alt="" />
            <h2>精品推荐</h2>
          </div>
          <div class="jingpin-r">
            <p>更多</p>
            <img src="../assets/img/arrow.png" alt="" />
          </div>
        </div>
        <!-- 排序图 -->
        <ul class="paixu">
          <li v-for="item in jinpinArr" :key="item.id">
            <div class="hots">
              <img
                src="../assets/img/section_hot.png"
                v-show="item.isHotSale"
                alt=""
              />
            </div>
            <div class="hots">
              <img
                src="../assets/img/section_new.png"
                v-show="item.isLatest"
                alt=""
              />
            </div>
            <img :src="'http://sc.wolfcode.cn' + item.coverImg" alt="" />
            <p>{{ item.name }}</p>
            <span class="jibenbox"
              >{{ item.coin }} <img src="../assets/img/monad.png" alt=""
            /></span>
            <div class="p-btn">立即兑换</div>
          </li>
        </ul>
        <!-- 热门推荐 -->
        <div class="jingpin">
          <div class="jingpin-l">
            <img src="../assets/img/jingpin.png" alt="" />
            <h2>热门推荐</h2>
          </div>
          <div class="jingpin-r">
            <p>更多</p>
            <img src="../assets/img/arrow.png" alt="" />
          </div>
        </div>
        <div class="content-banner">
          <img src="../assets/img/banner.4c6b6225.png" alt="" />
        </div>
        <!-- 排序图 -->
        <ul class="paixu">
          <li v-for="item in remenArr" :key="item.id">
            <div class="hots">
              <img
                src="../assets/img/section_hot.png"
                v-show="item.isHotSale"
                alt=""
              />
            </div>
            <div class="hots">
              <img
                src="../assets/img/section_new.png"
                v-show="item.isLatest"
                alt=""
              />
            </div>
            <img :src="'http://sc.wolfcode.cn' + item.coverImg" alt="" />
            <p>{{ item.name }}</p>
            <span class="jibenbox"
              >{{ item.coin }} <img src="../assets/img/monad.png" alt=""
            /></span>
            <div class="p-btn">立即兑换</div>
          </li>
          <!-- <li>
            <img src="../assets/img/listimg.jpg" alt="" />
            <p>叩丁狼精品T恤</p>
            <span class="jibenbox"
              >2000 <img src="../assets/img/monad.png" alt=""
            /></span>
            <div class="p-btn">立即兑换</div>
          </li>
          <li>
            <img src="../assets/img/listimg.jpg" alt="" />
            <p>叩丁狼精品T恤</p>
            <span class="jibenbox"
              >2000 <img src="../assets/img/monad.png" alt=""
            /></span>
            <div class="p-btn">立即兑换</div>
          </li>
          <li>
            <img src="../assets/img/listimg.jpg" alt="" />
            <p>叩丁狼精品T恤</p>
            <span class="jibenbox"
              >2000 <img src="../assets/img/monad.png" alt=""
            /></span>
            <div class="p-btn">立即兑换</div>
          </li> -->
        </ul>
      </div>
    </div>
    <div class="Introduction">
      <div class="wrap">
        <div class="Introduction-j">
          <img src="../assets/img/score.png" alt="" />
          <h2>鸡腿攻略</h2>
        </div>
        <div class="j-imgbox">
          <div class="j-sign">
            <h2>签到得积分</h2>
            <span>去签到</span>
            <img src="../assets/img/integral-01.9386d4bf.png" alt="" />
          </div>
          <div class="j-sign">
            <h2>购课得积分</h2>
            <span>去购课</span>
            <img src="../assets/img/integral-02.150d92a1.png" alt="" />
          </div>
          <div class="j-sign">
            <h2>推荐得积分</h2>
            <span>去推荐</span>
            <img src="../assets/img/integral-03.9870f3f1.png" alt="" />
          </div>
          <div class="j-sign">
            <h2>拼团得积分</h2>
            <span>去拼团</span>
            <img src="../assets/img/integral-04.afadcbdf.png" alt="" />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { JinpiAPI, RemenAPI } from "@/request/api";
export default {
  name: "HomeView",
  components: {},

  data() {
    return {
      jinpinArr: [],
      remenArr: [],
    };
  },
  async created() {
    let res = await JinpiAPI();
    let res2 = await RemenAPI();
    this.jinpinArr = res.data.data.data.records;
    this.remenArr = res2.data.data.data.records;

    console.log(this.jinpinArr, this.remenArr);
  },
};
</script>
<style lang="less" scoped>
.bannre {
  margin-bottom: 30px;
}
.integralMall-center {
  background-color: #f5f5f5;
  .jingpin {
    display: flex;
    justify-content: space-between;

    .jingpin-l {
      margin-top: 50px;
      display: flex;
      img {
        width: 40px;
        height: 36px;
      }
      h2 {
        width: 130px;
        height: 29px;
        margin-top: 5px;
        font-size: 30px;
        font-family: SourceHanSansSC;
        // font-weight: bold;
        color: #242b39;
        line-height: 23px;
        margin-left: 10px;
      }
    }
    .jingpin-r {
      width: 51px;
      display: flex;
      margin-top: 72px;
      img {
        margin-top: 5px;
        width: 14px;
        height: 14px;
        margin-left: 5px;
      }
      p {
        // width: 31px;
        // height: 15px;
        font-size: 16px;
        font-family: SourceHanSansSC;
        font-weight: 300;
        color: #666666;
        line-height: 23px;
      }
    }
  }
  .paixu {
    margin-top: 22px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
   

    li {
      background-color: #fff;
      margin-bottom: 56px;
      transition: 0.8s;
      position: relative;
      
      &:hover {
        transform: translateY(-10px);
        box-shadow:0 0 10px rgba(0,0,0,0.1) ;
        .p-btn {
          background-color: #0a328e;
          color: #fff;
        }
      }
    }
    .latest {
      position: absolute;
      left: 0;
      top: 0;
    }
    .hots {
      position: absolute;
      left: 0;
      top: 0;
    }
    P {
      margin-top: 22px;
      text-align: center;
      font-size: 18px;
      font-weight: 400;
      color: #333333;
    }
    .jibenbox {
      display: flex;
      text-align: center;
      width: 67px;
      height: 18px;
      line-height: 18px;
      margin-top: 16px;
      margin-left: 118px;
      img {
        margin-left: 5px;
        width: 20px;
        height: 20px;
      }
    }
    .p-btn {
      width: 100px;
      height: 36px;
      border: 1px solid #0a328e;
      margin-bottom: 32px;
      margin-top: 20px;
      text-align: center;
      margin-left: 93px;
      line-height: 36px;
      color: #0a328e;
      transition: 0.5s;
    }
  }
}
.content-banner {
  margin-top: 20px;
  margin-bottom: 30px;
}
.Introduction {
  .Introduction-j {
    display: flex;
    h2 {
      width: 130px;
      height: 29px;
      margin-top: 50px;
      font-size: 30px;
      font-family: SourceHanSansSC;
      // font-weight: bold;
      color: #242b39;
      line-height: 23px;
      margin-left: 10px;
    }
    img {
      margin-top: 44px;
      margin-left: 5px;
    }
  }
  .j-imgbox {
    display: flex;
    justify-content: space-between;
    margin-bottom: 47px;
    margin-top: 23px;
    position: relative;

    .j-sign {
      width: 285px;
      height: 168px;
      overflow: hidden;
      cursor: pointer;

      h2 {
        position: absolute;
        margin-top: 43px;
        margin-left: 20px;
        font-size: 30px;
        font-family: SourceHanSansSC;
        font-weight: bold;
        color: #ffffff;
        line-height: 23px;
        z-index: 999;
      }
      span {
        position: absolute;
        margin-top: 91px;
        margin-left: 21px;
        border: 1px solid #fff;
        color: #fff;
        padding: 6px 23px;
        z-index: 999;
      }
      img {
        transition: 0.2s;
        &:hover {
          transform: scale(1.1);
        }
      }
    }
  }
}
</style>
